﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ErrorDateByQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["AdminName"] == null)
            Response.Redirect("login.aspx");
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["Date"] == null)
                return;
            DAL.ErrorLogDALs errorlogdals = new DAL.ErrorLogDALs();
            DataSet ds = errorlogdals.ExecuteSql("select queryid,sendmessage,checktype,comparetype,sum(total) total,url From viewerrorlog where DTime='"+Request.QueryString["Date"]+"' group by queryid,url,checktype,comparetype,sendmessage");

            this.GridView1.DataSource = ds;
            this.GridView1.DataBind();
            this.TextBox1.Text = Request.QueryString["Date"];
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {//http://localhost:13502/WWW/ErrorDateByQuery.aspx?Date=2009/12/28
        Response.Redirect("ErrorDateByQuery.aspx?Date=" + this.TextBox1.Text.Trim());
    }
}
